package com.bdjk.bdmw.InfoGath.common.constants;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class JdbcConstants {

	private static Properties CONFIG = new Properties();

	static {
		try {
			CONFIG.load(Thread.currentThread().getContextClassLoader()
					.getResourceAsStream("jdbc/jdbc.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static final String DRIVER_CLASSNAME = CONFIG
			.getProperty("jdbc_driverClassName");

	public static final String URL = CONFIG.getProperty("jdbc_url");

	public static final String USERNAME = CONFIG.getProperty("jdbc_username");

	public static final String PASSWORD = CONFIG.getProperty("jdbc_password");

	public static void main(String[] args) {
		Properties props = new Properties();
		try {
			InputStream in = new BufferedInputStream(new FileInputStream(
					"/jdbc/jdbc.properties"));
			props.load(in);
			String value = props.getProperty("jdbc_driverClassName");
			System.out.println("jdbc_driverClassName" + value);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
